<div class="ibox">
    <div class="ibox-content">
        <form method="post" class="form-horizontal" action="${cxt!}/upcoming/events/update" id="articleForm" >
        <input type="hidden" id="upcomingid" name="id" value="${updateUpcomingEvents.id!}">
            <div class="form-group">
                <div class="col-md-2"></div>
                <div class="col-md-1">
                    <label>${_res["upcoming.events.url"]}:<span class="fontColorRed"> *</span></label>
                </div>
                <div class="col-md-3">
                    <div class="col-md-3 proimgfiles">
                        <a href="javascript:void(0)" class="filesIconAdd" id="uploadproimgfiles">
                            <!-- //ajax片段开始 -->
                            <%  #ajax uploadproimgfiles: {%> 
                                <% if (isEmpty(uploadFile)) { %>
                                    <img src="${imgCxt!}/${updateUpcomingEvents.url!}" width="100%" height="100%" style="position: relative; z-index: 99999;" >
                                <% } else { %>
                                    <input type="hidden" name="upcoming.url" value="${uploadFile.path!}" /> 
                                    <img src="${imgCxt!}/${uploadFile.path!}" width="100%" height="100%" style="position: relative; z-index: 99999;">
                                <% } %>
                            <% } %>
                            <!-- //ajax片段结尾 -->
                        </a> 
                        <input type="file" style="opacity: 0" id="fileuploadproimgfiles" name="url" />
                    </div>
                </div>
                <div class="col-md-1">
                    <label>${_res["upcoming.events.urlen"]}:<span class="fontColorRed"> *</span></label>
                </div>
                <!-- 上传英文封面 -->
                <div class="col-md-3">
                    <div class="col-md-3 proimgfiles">
                        <a href="javascript:void(0)" class="filesIconAdd" id="uploadDatumFile">
                            <!-- //ajax片段开始  -->
                            <% #ajax uploadDatumFile: {%> 
                                <% if (isEmpty(uploadFile)) { %>
                                    <img src="${imgCxt!}/${updateUpcomingEvents.urlen!}" width="100%" height="100%" style="position: relative; z-index: 99999;">
                                <% } else { %>
                                    <input type="hidden" name="upcoming.urlen" value="${uploadFile.path!}" />
                                    <img src="${imgCxt!}/${uploadFile.path!}" width="100%" height="100%" style="position: relative; z-index: 99999;">
                                <% } %>
                            <% } %>
                            <!-- //ajax片段结尾 -->
                        </a> 
                        <input type="file" style="opacity: 0" id="fileuploadDatumFile" name="urlen" />
                    </div>
                </div>
            </div>
            <div class="hr-line-dashed"></div>
            <div class="form-group">
                <label class="col-sm-2 control-label">${_res["upcoming.events.title"]}:<span class="fontColorRed"> *</span></label>
                <div class="col-sm-3">
                    <input type="text" class="form-control" name="upcoming.title" value="${updateUpcomingEvents.title!}" required aria-required="true">
                </div>       
                
                 <label class="col-md-2 control-label">${_res["wealth.college.englishtitle"]}:<span class="fontColorRed"> *</span></label>
                 <div class="col-md-3">
                      <input type="text" class="form-control" name="upcoming.titleen" value="${updateUpcomingEvents.titleen!}" required aria-required="true">
                 </div>                      
           </div>
           <div class="hr-line-dashed"></div>
           
                      <div class="form-group">
                <label class="col-sm-2 control-label">${_res["upcoming.events.contacter"]}:<span class="fontColorRed">&nbsp;*</span></label>
                <div class="col-sm-3">
                    <input type="text" class="form-control" name="upcoming.contacter" value="${updateUpcomingEvents.contacter!}" required aria-required="true">
                </div>	   
                
	             <label class="col-md-2 control-label">${_res["upcoming.events.emailcontact"]}:<span class="fontColorRed">&nbsp;*</span></label>
	             <div id="divId" class="col-md-3">
	              	<input type="text" class="form-control" name="upcoming.emailcontact" value="${updateUpcomingEvents.emailcontact!}" required aria-required="true">
	             </div>	                  
           </div>
           <div class="hr-line-dashed"></div>
           
           <div class="form-group">
                <label class="col-sm-2 control-label">${_res["upcoming.events.mobilecontact"]}:<span class="fontColorRed"> *</span></label>
                <div class="col-sm-3">
                    <input type="text" class="form-control" name="upcoming.mobilecontact" value="${updateUpcomingEvents.mobilecontact!}" required aria-required="true">
                </div>       
                
                 <label class="col-md-2 control-label">${_res["upcoming.events.status"]}:<span class="fontColorRed"> *</span></label>
                 <div class="col-md-3">
                      <#dict type="select"  name="upcoming.status" value="${updateUpcomingEvents.status!}" id="status" dictCode="COMMON_STATUS" />
                 </div>                      
           </div>
           <div class="hr-line-dashed"></div>
           
           <div class="form-group">
                <label class="col-sm-2 control-label">${_res["upcoming.events.fromTime"]}:<span class="fontColorRed">&nbsp;*</span></label>
                <div class="col-sm-3">
                    <input id="fromTimeDivId" class="form-control layer-date laydate-icon" name="upcoming.fromTime" value="${updateUpcomingEvents.fromTime!}"  placeholder="${_res['upcoming.events.fromTime']}" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})" required aria-required="true" />
                </div>	   
                
	            <label class="col-md-2 control-label">${_res["upcoming.events.toTime"]}:<span class="fontColorRed">&nbsp;*</span></label>
	            <div class="col-md-3">
	              <input class="form-control layer-date laydate-icon"  data-rule-comparedate="#fromTimeDivId" name="upcoming.toTime" value="${updateUpcomingEvents.toTime!}" placeholder="${_res['upcoming.events.toTime']}" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})" required aria-required="true" />
	            </div>	                  
           </div>
           <div class="hr-line-dashed"></div>
           
           <div class="form-group">
                <label class="col-md-2 control-label">${_res["upcoming.events.eventdate"]}:<span class="fontColorRed">&nbsp;*</span></label>
	            <div class="col-md-3">
                   <input class="form-control layer-date laydate-icon" name="upcoming.eventdate" value="${updateUpcomingEvents.eventdate!}" placeholder="${_res['upcoming.events.eventdate']}" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})" required aria-required="true" />
	            </div>	   

                <label class="col-md-2 control-label">${_res["upcoming.events.address"]}:<span class="fontColorRed">&nbsp;*</span></label>
	            <div class="col-md-3">
                   <input type="text" class="form-control" name="upcoming.address" value="${updateUpcomingEvents.address!}" placeholder="${_res['upcoming.events.address']}"  required aria-required="true" />
	            </div>	   
           </div>
           <div class="hr-line-dashed"></div>
           
            <div class="form-group">
                <label class="col-md-2 control-label">${_res["upcoming.events.content"]}:<span class="fontColorRed"> *</span></label>
                <div class="col-md-8">
	                <script name="upcoming.content" type="text/plain" id="container" style="width:100%; min-height:350px !important">
                    	${updateUpcomingEvents.content!}
                	</script>
                </div>
            </div>
            <div class="hr-line-dashed"></div>
            
            <div class="form-group">
                <label class="col-md-2 control-label">${_res["upcoming.events.contenten"]}:<span class="fontColorRed"> *</span></label>
                <div class="col-md-8">
	                <script id="container_english" name="upcoming.contenten" type="text/plain" style="width:100%; min-height:350px !important">
                    	${updateUpcomingEvents.contenten!}
                	</script>
                </div>
            </div>
            
            <div class="form-group" style="margin-bottom:55px;">
                <div class="row">
                    <div class="col-md-6">
                        <label class="col-md-12 control-label "> 
                            <% if(hasPrivilegeUrl("upcomingList")){ %>
								<button type="button" class="btn btn-warning" onClick="ajaxContent('/upcoming/events/list');">${_res["system.return"]}</button>
							<% } %> 
							<% if(hasPrivilegeUrl("upcomingUpdate")){ %>
								<button type="submit" class="btn btn-primary"> ${_res["system.submit"]} </button> 
							<% } %> 
                        </label>
                    </div>
                </div>
            </div>
        </form>
    </div>
</div>
<#submit formId="articleForm" divId="content" />
<script>
    $(document).ready(function() {
        var editor = new UE.ui.Editor();  
        editor.render("container");
        
        var editor_english = new UE.ui.Editor();  
        editor_english.render("container_english");
        
        $("a[id^='upload']").on('click', function() {
            var id = $(this).attr("id");
            $("#file" + id).click();
        });
    
        // 选择文件之后执行上传ajaxFileUpload2(divId,fileElementId,toUrl,uploadType,uploadFiles,callback)
        $("input[id^='fileuploadproimgfiles']").on("change", function() {
            var fileElementId = $(this).attr("id");
            ajaxFileUpload2("uploadproimgfiles",fileElementId,"/realty/academyarticle/upcomingEvents/update.html#uploadproimgfiles","academyArticle","uploadFile");
        });
        
        // 英文封面修改上传
        $("input[id^='fileuploadDatumFile'").on("change", function() {
            var fileElementId = $(this).attr("id");
            ajaxFileUpload2("uploadDatumFile",fileElementId,"/realty/academyarticle/upcomingEvents/update.html#uploadDatumFile","academyArticle","uploadFile");
        });
    });    
</script>